set SPAdminTool=%CommonProgramFiles%\Microsoft Shared\web server extensions\12\BIN\stsadm.exe
@ECHO OFF
echo Installing the Sharpoint DatePicker Solution......
ECHO.
ECHO. --- Making required directories  in 12 folder ---
rd /s /q "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES\DatePicker
rd /s /q "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\Js
rd /s /q "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\SharepointDatePickerDemo

mkdir "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES\DatePicker"
mkdir "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\Js"
mkdir "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\SharepointDatePickerDemo

echo Making the Cabinet for Sharepoint DatePicker Solution....
ECHO.
set MakeCabTool=Assemblies\makecab.exe
"%MakeCabTool%" -f solution.ddf
ECHO.
ECHO.
echo Installing and Deploying the Sharepoint DatePicker Solution ......
ECHO.
Assemblies\sleep.exe 2
ECHO. --- adding solution to store ---
"%SPAdminTool%" -o addsolution -filename Package\SharepointDatePicker.wsp
ECHO. --- deploying solution to site Collection ---
"%SPAdminTool%" -o deploysolution -immediate -allowGacDeployment -name SharepointDatePicker.wsp -url %1 -force
"%SPAdminTool%" -o execadmsvcjobs
ECHO.
pause
ECHO.
popd
iisreset